﻿
'*******************************************************************
' Program: Data Center Visio Rack Tool
' Author: Albert E Edlund
' Date:
'
' Purpose:
'
'
'
'*******************************************************************


Imports Microsoft.Practices.EnterpriseLibrary.Common
Imports Microsoft.Practices.EnterpriseLibrary.Data
Imports Microsoft.Practices.EnterpriseLibrary.ExceptionHandling
Imports Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging


Imports System
Imports System.ComponentModel
Imports System.Collections.Generic


Public Class dc_CabinetRow
    Implements INotifyPropertyChanged


#Region "Events"

    Public Event PropertyChanged(ByVal sender As Object, ByVal e As System.ComponentModel.PropertyChangedEventArgs) Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged

    Private Sub OnPropertyChanged(ByVal info As String)
        RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(info))
    End Sub

#End Region

#Region " Constructor "

    Public Sub New()
        initProperties()
    End Sub

    Public Sub New(ByVal strUserId As String)
        initProperties()
        Me.m_rowlastedit = strUserId
    End Sub

#End Region

#Region " Properties and Fields "


    Private Const constRowId As String = "RowId"
    Private Const constRowLoc As Int32 = -1
    Private Const constRowName As String = "na"
    Private Const constRowSide As String = ""
    Private Const constRowGrid As String = "na"
    Private Const constRowDefaultVendor As Int32 = -1
    Private Const constRowCabCt As Integer = 1
    Private Const constRowOrientation As String = "horizontal"
    Private Const constRowComments As String = "none"
    Private Const constRowKey As Int32 = -1
    Private Const constRowLastUpdate As Date = #1/1/2001#
    Private Const constRowLastEdit As String = ""


    Private m_rowkey As Int32
    Property rowKey() As Int32
        Get
            Return Me.m_rowkey
        End Get
        Set(ByVal value As Int32)
            Me.m_rowkey = value
            Me.OnPropertyChanged("rowKey")
        End Set
    End Property

    Private m_rowid As String
    Property rowId() As String
        Get
            Return Me.m_rowid
        End Get
        Set(ByVal value As String)
            Me.m_rowid = value
            Me.OnPropertyChanged("rowId")
        End Set
    End Property

    ' rowid may not be unique, so we need to know what site
    Private m_rowloc As Int32
    Property rowLoc() As Int32
        Get
            Return Me.m_rowloc
        End Get
        Set(ByVal value As Int32)
            Me.m_rowloc = value
            Me.OnPropertyChanged("rowLoc")
        End Set
    End Property

    ' vertical position on datacenter grid
    Private m_rowname As String
    Property rowName() As String
        Get
            Return Me.m_rowname
        End Get
        Set(ByVal value As String)
            Me.m_rowname = value
            Me.OnPropertyChanged("rowName")
        End Set
    End Property

    ' this is really used to separate groups of cabinets (about nine appears to be good)
    Private m_rowside As String
    Property rowSide() As String
        Get
            Return Me.m_rowside
        End Get
        Set(ByVal value As String)
            Me.m_rowside = value
            Me.OnPropertyChanged("rowSide")
        End Set
    End Property

    ' specific x and y on the grid 
    Private m_rowgrid As String
    Property rowGrid() As String
        Get
            Return Me.m_rowgrid
        End Get
        Set(ByVal value As String)
            Me.m_rowgrid = value
            Me.OnPropertyChanged("rowGrid")
        End Set
    End Property

    Private m_rowdefaultvendor As Int32
    Property rowDefaultVendor() As Int32
        Get
            Return Me.m_rowdefaultvendor
        End Get
        Set(ByVal value As Int32)
            Me.m_rowdefaultvendor = value
            Me.OnPropertyChanged("rowDefaultVendor")
        End Set
    End Property

    ' how many cabinets in this specific group
    Private m_rowcabct As Integer
    Property rowCabCt() As Integer
        Get
            Return Me.m_rowcabct
        End Get
        Set(ByVal value As Integer)
            Me.m_rowcabct = value
            Me.OnPropertyChanged("rowCabCt")
        End Set
    End Property

    ' currently not used, planned for data center floor drawing
    Private m_roworientation As String
    Property rowOrientation() As String
        Get
            Return Me.m_roworientation
        End Get
        Set(ByVal value As String)
            Me.m_roworientation = value
            Me.OnPropertyChanged("rowOrientation")
        End Set
    End Property

    Private m_rowcomments As String
    Property rowComments() As String
        Get
            Return Me.m_rowcomments
        End Get
        Set(ByVal value As String)
            Me.m_rowcomments = value
            Me.OnPropertyChanged("rowComments")
        End Set
    End Property

    Private m_rowlastupdate As Date
    Property rowLastUpdate() As Date
        Get
            Return Me.m_rowlastupdate
        End Get
        Set(ByVal value As Date)
            Me.m_rowlastupdate = value
            Me.OnPropertyChanged("rowLastUpdate")
        End Set
    End Property

    Private m_rowlastedit As String
    Property rowLastEdit() As String
        Get
            Return Me.m_rowlastedit
        End Get
        Set(ByVal value As String)
            Me.m_rowlastedit = value
            Me.OnPropertyChanged("rowLastEdit")
        End Set
    End Property

#End Region

#Region " Methods "


    Public Sub initProperties()

        Try

            rowKey = constRowKey
            rowId = constRowId
            rowLoc = constRowLoc
            rowName = constRowName
            rowSide = constRowSide
            rowGrid = constRowGrid
            rowDefaultVendor = constRowDefaultVendor
            rowCabCt = constRowCabCt
            rowOrientation = constRowOrientation
            rowComments = constRowComments
            rowLastUpdate = Now()
            rowLastEdit = constRowLastEdit

        Catch ex As Exception
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(ex, "Log Only Policy")
            If (rethrow) Then
                Throw
            End If
        End Try

    End Sub




#End Region


End Class
